import random    
a=[]
for i in range(8):
    b = random.randint(0,100)
    a.append(b)
print(a)

s=input("初始位置:")
pos=int(s)
for i in range(0,7):
    for j in range(7,i,-1):
        if a[j]<a[j-1]:
            a[j-1],a[j]=a[j],a[j-1]
            if pos==j:
                pos=j-1
                s=s+"→"+str(pos)
            elif pos==j-1:
                pos=j
                s=s+"→"+str(pos)
     
print(s)
    

